<template>
	<DetailPage v-bind="detailConfig" :model="nowData"></DetailPage>
</template>

<script setup lang="ts">
import apiMod from '@/apiMod'
import { getAreaObj } from '@/utils/util'
import DetailPage from '@/views/aplid/DetailPage/index.vue'
import { detailConfig } from '../../config'
import { useCommonStore } from '@/stores/common'

const { setLoading } = useCommonStore()
const nowRowData: any = inject('nowRowData')
const nowData: any = ref({})

const props = defineProps({
	chainViewInfo:{
		type:Object,
		default:()=>({})
	},
	isBlockchain:{
		type:Boolean,
		default:false
	}
})

const getInitData = () => {
	setLoading()
	apiMod.dpServiceOrgHome_detail(nowRowData.id).then((res) => {
		const areas = getAreaObj(res.data,'now')
		const region = getAreaObj(res.data)
		nowData.value = {
			...res.data,
			areas,
			region,
		}
		setLoading()
	})
}

onMounted(() => {
	if(props.isBlockchain){
		nowData.value = props.chainViewInfo
	}else{
		getInitData()
	}
})
</script>

<style scoped>
.bottom {
	margin-top: 13px;
	line-height: 12px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.detail-label {
	color: #eee;
}

.image {
	width: 90%;
	/* height: 220px; */
	display: block;
}
</style>
